﻿using Sunny.FrameDecoder;
using System.Net;

namespace Sunny.Udp
{
    /// <summary>
    /// UDP字节数组解码数据事件类
    /// </summary>
    public class UdpByteDataEventArgs : ByteDataEventArgs
    {
        /// <summary>
        /// 客户端
        /// </summary>
        public IPEndPoint IPEndPoint { get; }

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="ipEndPoint">客户端</param>
        /// <param name="decoder">解码器</param>
        /// <param name="value">数据</param>
        public UdpByteDataEventArgs(IPEndPoint ipEndPoint, BaseByteFrameDecoder decoder, byte[] value) : base(decoder, value)
        {
            IPEndPoint = ipEndPoint;
        }
    }

    /// <summary>
    /// 字节数组数据事件类
    /// </summary>
    /// <param name="sender">对象</param>
    /// <param name="e">字节数组数据事件类</param>
    public delegate void OnUdpByteEventHandler(object sender, UdpByteDataEventArgs e);
}
